//包含action和 creator(action工厂函数)
import { ADDUSERNAME, ADDCONTEXT, SUBMITLIST, DELITEM, CLEARALL } from "./action-types"
// import axios from "axios"

export const submitList = (comment) => ({ type: SUBMITLIST, data: comment })

export const delItem = (index) => ({ type: DELITEM, data: index })

export const addUsername = (username) => ({ type: ADDUSERNAME, data: username })

export const addContext = (context) => ({ type: ADDCONTEXT, data: context })

export const clearAll = () => ({ type: CLEARALL })

//redux
// export const testAjax = () => {
//     return () => {
//         setTimeout( ()=>{
//             console.log("testAjax");
//         },1000)
//     }
// }